<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>Nordic Thingy:52 v2.2.0 : Compiling new firmware</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet_offline.css" rel="stylesheet" type="text/css"/>
<link href="nordic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%" class="blank">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Nordic Semiconductor" src="nordic_small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nordic Thingy:52 v2.2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
<script>
var url=window.location.href.split("/").reverse()[1];
var validLinks= ["nrf5","s130","s132","s212","s332"];
var index;
for (index = 0; index < validLinks.length; ++index) {
   if ( url.indexOf(validLinks[index]) !== -1 ) {
      document.getElementById(validLinks[index]).setAttribute('class', 'doclinks docselected');
   };
};
</script>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('firmware_compile.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Compiling new firmware </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>You must compile the Thingy firmware using either GCC or Keil μVision.</p>
<p>For prerequisites related to compiling, see <a href="https://nordicsemiconductor.github.io/Nordic-Thingy52-FW/" target="_blank">Nordic Thingy:52 GitHub page</a>.</p>
<h1><a class="anchor" id="compile_keil"></a>
Compiling with Keil</h1>
<p>Before starting this procedure, make sure you have <a href="https://www.keil.com/demo/eval/arm.htm/" target="_blank">Keil</a> installed on your computer.</p>
<p>Follow these steps to compile the Thingy firmware using Keil:</p><ol type="1">
<li>Navigate to the folder <code>\project\pca20020_s132\arm5_no_packs\</code> and double-click the project file <code>ble_app_thingy_s132_pca20020.uvprojx</code>. The μVision integrated development environment (IDE) opens. <div class="image">
<img src="keil1.png" alt="keil1.png"/>
<div class="caption">
Keil μVision IDE</div></div>
</li>
<li>If you are compiling for the newest Thingy hardware version, select <b>release</b> from the target drop-down menu, as shown in the figure. <div class="image">
<img src="keil2.png" alt="keil2.png"/>
<div class="caption">
Select 'release' from the menu</div></div>
</li>
<li>Select the appropriate Thingy version from the list. To check the version of your Thingy, you must remove the top rubber cover. The version number can be found on a white label on the PCB. To compile a debug version, select <b>debug</b>.</li>
<li>To build the project, press F7 or click <b>Build</b>. The output will be visible in the Build Output window at the bottom and should finish with "0 Errors, 0 Warnings". If you are compiling for an older Thingy version, you will receive a warning stating the version that you are compiling for. <div class="image">
<img src="keil3.png" alt="keil3.png"/>
<div class="caption">
Building the project</div></div>
 </li>
</ol>
<h1><a class="anchor" id="compile_gcc"></a>
Compiling with GCC</h1>
<p>Before starting this procedure, make sure you have the following components installed on your computer:</p><ul>
<li>GNU toolchain for ARM Cortex-M</li>
<li>GNU make or CMake</li>
</ul>
<p>Follow these steps to compile the Thingy firmware using GCC:</p><ol type="1">
<li>Set up the path in <code>makefile.windows</code> or <code>makefile.posix</code>, depending on the platform that you are using. The .posix file is used when working on either Linux or OS X.<ol type="a">
<li>Open the makefile in a text editor.</li>
<li>Make sure that the <code>GNU_INSTALL_ROOT</code> variable points to your <code>GNU Tools for ARM Embedded Processors</code> directory. For example: <div class="fragment"><div class="line">GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/4.9 2015q3   <span class="comment">// Toolchain path</span></div><div class="line">GNU_VERSION := 4.9.3</div><div class="line">GNU_PREFIX := arm-none-eabi</div></div><!-- fragment --></li>
</ol>
</li>
<li>Navigate to the folder <code>project\pca20020_s132\armgcc</code>.</li>
<li>Run the following command to compile the Thingy application code: <div class="fragment"><div class="line">make -j</div></div><!-- fragment --> </li>
</ol>
</div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="topicfooter">
<a href="mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback" id="maillink">Documentation feedback</a> | <a href="https://devzone.nordicsemi.com/questions/" target="_blank">Developer Zone</a> | <a href="http://response.nordicsemi.com/subscribe-to-our-newsletters" target="_blank">Subscribe</a> | Updated <span id="date"/>
<script>
var date = new Date("Thu Feb 7 2019" + " UTC");
document.getElementById("date").innerHTML = date.toJSON().slice(0, 10);
var url=window.location.href.split("?")[0];
var filename=url.substring(url.lastIndexOf('/')+1);
document.getElementById("maillink").href = "mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback"+decodeURIComponent("%26")+"body=File%20name%3A%20"+encodeURIComponent(filename);
</script>
</div>
</body>
</html>
